//
//  HPButton.m
//  ShouFaBao
//
//  Created by User on 14/12/9.
//  Copyright (c) 2014年 HeXieSoftWare. All rights reserved.
//

#import "HPButton.h"

@implementation HPButton

- (void)setImageAndTitle:(UIImage *)image title:(NSString *)title
{
	self.imageV = [[UIImageView alloc] initWithFrame:CGRectMake(20, 20, CGRectGetWidth(self.bounds)-40, CGRectGetHeight(self.bounds)*3/5.0-40)];
	self.imageV.image = image;
	self.imageV.contentMode = UIViewContentModeCenter;
	[self addSubview:self.imageV];

	self.label = [[UILabel alloc] initWithFrame:CGRectMake(20, CGRectGetMaxX(self.bounds)*3/5.0, CGRectGetWidth(self.bounds)-40, CGRectGetHeight(self.bounds)*2/5.0)];
	self.label.textColor = [UIColor darkGrayColor];
	self.label.text = title;
	self.label.textAlignment = NSTextAlignmentCenter;
	self.label.font = [UIFont systemFontOfSize:15];
	self.label.numberOfLines = 2;
	self.label.lineBreakMode = NSLineBreakByWordWrapping;
	[self.label alignTop];
	[self addSubview:self.label];
}


// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}


@end
